/*
 * @description 抽象工厂测试类
 * @author 罗添煦
 * @create 2024-08-21 上午10:15
 */
public class AbstractFactoryTest {
    public static void main(String[] args) {
        //创建苹果工厂
        ProductFactory pgFactory = new PgFactory();
        //创建苹果电脑
        Computer pgComputer = pgFactory.createComputer();
        pgComputer.trunOn();
        Phone pgPhone = pgFactory.createPhone();
        pgPhone.trunOn();
        //创建华为工厂
        ProductFactory huaweiFactory = new HuaweiFactory();
        Computer huaweiComputer = huaweiFactory.createComputer();
        huaweiComputer.trunOn();
    }
}
